package com.zimu.api.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zimu.api.mapper.UserMapper;
import com.zimu.common.model.entity.User;
import com.zimu.common.service.CommonUserService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;

@DubboService
public class CommonUserServiceImpl implements CommonUserService {
    @Resource
    UserMapper userMapper;
    //通过accessKey查找User
    @Override
    public User getUserByAccessKey(String accessKey){
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("accessKey",accessKey);
        return userMapper.selectOne(queryWrapper);
    }
}
